package redisinit

import (
	"community/appconfig"
	"fmt"
	"github.com/go-redis/redis"
)

var Client *redis.Client

func ExampleNewClient() {
	data := appconfig.Conf.Redis
	Client = redis.NewClient(&redis.Options{
		Addr:     data.Addr,
		Password: data.Password, // no password set
		DB:       data.DB,       // use default DB
	})

	pong, err := Client.Ping().Result()
	fmt.Println(pong, err)
	// Output: PONG <nil>
}
